
<template>
  <div>
    <h1>{{ msg }}</h1>
    <h2>我的年龄：{{ age }}</h2>
    <h3>我的姓名：{{ people.name }}</h3>
    <h3>我的钱：{{ people.money }}</h3>
    <h3>我的高度：{{ people.height }}</h3>
    <h3>计算后：{{ text }}</h3>
    <p>
      Recommended IDE setup:
      <a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
      +
      <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
    </p>

    <p>
      <a href="https://vitejs.dev/guide/features.html" target="_blank">
        Vite Documentation
      </a>
      |
      <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a>
    </p>
    <button type="button" @click="handle">count is: {{ count }}</button>
    <p>
      Edit
      <code>components/HelloWorld.vue</code> to test hot module replacement.
    </p>
  </div>
</template>
<script setup>
import { computed, reactive, ref, watch } from "vue";

defineProps({
  msg: {
    type: String,
    default: "我是你爸爸真伟大，养你那么大，你还不听话，逼逼赖赖来玩耍",
  },
});
const age = ref(22);
const count = ref(0);
const people = reactive({
  name: "小明",
  height: "我非常高",
  money: "我么得钱",
});
watch(age, (newVal, oldVal) => {
  people.money = newVal + 1 + "=" + oldVal;
});
const text = computed(() => age.value + 10);
function handle() {
  age.value += 100;
  people.name += age.value;
}
</script>


<style scoped>
a {
  color: #42b983;
}
</style>
